class Solution {
    public int[] twoSum(int[] nums, int target) {
        HashMap<Integer,Integer>map=new HashMap<>();
        int n=nums.length;
        for(int i=0;i<n;i++)
        {
            Integer shu=map.get(nums[i]);
            if(shu!=null)
            {
                return new int[]{shu,i};
            }
            map.put(target-nums[i],i);
        }
        return nums;
    }
}
